import { lazy } from 'react';
import { RouteType } from '../interface/route';
import {
    AppstoreOutlined,
    FundOutlined,
    ShoppingCartOutlined,
} from '@ant-design/icons';

// 一级路由
const Home = lazy(() => import('../page/Home'))
const Login = lazy(() => import('../page/Login'))
const Submit = lazy(() => import('../page/Submit'))

// 二级路由
const Housing = lazy(() => import("../page/Home/Housing"));
const Live = lazy(() => import("../page/Home/Live"));
const Group = lazy(() => import("../page/Home/Group"));
const Audit = lazy(() => import("../page/Home/Audit"));
const Order = lazy(() => import("../page/Home/Order"));
const Consult = lazy(() => import("../page/Home/Consult"));
const Broker = lazy(() => import("../page/Home/Broker"));

// 二级路由
const page: RouteType[] = [{
    path: '/',
    lable: '房源管理',
    element: <Housing></Housing>,
    icon: <AppstoreOutlined />
}, {
    path: '/live',
    lable: '直播管理',
    element: <Live></Live>,
    icon: <FundOutlined />
}, {
    path: '/group',
    lable: '团购管理',
    element: <Group></Group>,
    icon: <ShoppingCartOutlined />
}, {
    path: '/audit',
    lable: '审核管理',
    element: <Audit></Audit>,
    icon: <AppstoreOutlined></AppstoreOutlined>
}, {
    path: '/order',
    lable: '订单管理',
    element: <Order></Order>,
    icon: <FundOutlined />
}, {
    path: '/consult',
    lable: '咨询管理',
    element: <Consult></Consult>,
    icon: <FundOutlined></FundOutlined>
}, {
    path: '/broker',
    lable: '经纪人管理',
    element: <Broker></Broker>,
    icon: <FundOutlined></FundOutlined>
}]

const list: RouteType[] = [{
    path: '/',
    element: <Home></Home>,
    children: page
}, {
    path: '/login',
    element: <Login></Login>,
}, {
    path: '/submit',
    element: <Submit></Submit>,
}]

export {
    page
}

export default list;
